--- Code that leads to confusing/wrong error messages
module tests.messages.Case1 where

{--

    This gives 2 messages on line 20:

    > type error in expression f x type is: a expected: b

    This is correct, but could be more explicit by pointing out that
    - @f x :: a@ because @f :: b->a@ and @x :: b@
    - @f x :: b@ because @f :: b->a@ and @f (f b) :: a@

    > type `b` is not as polymorphic as suggested in the annotation where just `a` is announced.

    This is confusing and also wrong. 

    Resolution: This message should be suppressed if there is already a type error.
-}
twice ∷ (a→b) → a → b
twice f x = f (f x :: String)